package com.woniu.elderly.operation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.common.entity.Openotice;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface OpenoticeMapper extends BaseMapper<Openotice> {

    List<Openotice> selectNoticeList(Openotice openotice);

    void updateNotice(Openotice openotice);

    void deleteNotice(long nid);

    void insertNotice(Openotice openotice);

    Openotice selectContentByNid(long nid);

    //向用户展示的是已发布的文章
    List<Openotice> selectNoticeListByNstate(Openotice openotice);

    //浏览量
    @Update("UPDATE openotice SET viewcount = viewcount + 1 WHERE nid = #{nid}")
    int increaseViewCountById(Long id);

}
